﻿
<template>
<div class="card-fill layout-padding">
<el-card shadow="hover" class="layout-padding-auto" >
  <WtmSearcher v-model="searchDataProductBOM" @search="()=>{getTableDataProductBOM();}">
      <el-row>
        <el-col :xs="24" :lg="8" class="mb20">
        <el-form-item ref="FactoryCode_FormItem" prop="FactoryCode" :label="$t('message.autotrans._Model_ProductBOM_factoryCode')">
            <el-input v-model="searchDataProductBOM.FactoryCode" clearable></el-input>
        </el-form-item>

        </el-col>
        <el-col :xs="24" :lg="8" class="mb20">
        <el-form-item ref="Assemblyline_FormItem" prop="Assemblyline" :label="$t('message.autotrans._Model_ProductBOM_assemblyline')">
            <el-input v-model="searchDataProductBOM.Assemblyline" clearable></el-input>
        </el-form-item>

        </el-col>
        <el-col :xs="24" :lg="8" class="mb20">
        <el-form-item ref="OperationCode_FormItem" prop="OperationCode" :label="$t('message.autotrans._Model_ProductBOM_operationCode')">
            <el-input v-model="searchDataProductBOM.OperationCode" clearable></el-input>
        </el-form-item>

        </el-col>
        <el-col :xs="24" :lg="8" class="mb20">
        <el-form-item ref="OrderCode_FormItem" prop="OrderCode" :label="$t('message.autotrans._Model_ProductBOM_orderCode')">
            <el-input v-model="searchDataProductBOM.OrderCode" clearable></el-input>
        </el-form-item>

        </el-col>
        <el-col :xs="24" :lg="8" class="mb20">
        <el-form-item ref="ScheduleNumber_FormItem" prop="ScheduleNumber" :label="$t('message.autotrans._Model_ProductBOM_scheduleNumber')">
            <el-input v-model="searchDataProductBOM.ScheduleNumber" clearable></el-input>
        </el-form-item>

        </el-col>
        <el-col :xs="24" :lg="8" class="mb20">
        <el-form-item ref="AddTime_FormItem" prop="AddTime" :label="$t('message.autotrans._Model_ProductBOM_addTime')">
            <el-input v-model="searchDataProductBOM.AddTime" clearable></el-input>
        </el-form-item>

        </el-col>
        <el-col :xs="24" :lg="8" class="mb20">
        <el-form-item ref="AssemblyConsumption_FormItem" prop="AssemblyConsumption" :label="$t('message.autotrans._Model_ProductBOM_assemblyConsumption')">
            <el-input v-model="searchDataProductBOM.AssemblyConsumption" clearable></el-input>
        </el-form-item>

        </el-col>
        <el-col :xs="24" :lg="8" class="mb20">
        <el-form-item ref="AssemblyMaterialCode_FormItem" prop="AssemblyMaterialCode" :label="$t('message.autotrans._Model_ProductBOM_assemblyMaterialCode')">
            <el-input v-model="searchDataProductBOM.AssemblyMaterialCode" clearable></el-input>
        </el-form-item>

        </el-col>
        <el-col :xs="24" :lg="8" class="mb20">
        <el-form-item ref="AssemblyMaterialId_FormItem" prop="AssemblyMaterialId" :label="$t('message.autotrans._Model_ProductBOM_assemblyMaterialId')">
            <el-input v-model="searchDataProductBOM.AssemblyMaterialId" clearable></el-input>
        </el-form-item>

        </el-col>
        <el-col :xs="24" :lg="8" class="mb20">
        <el-form-item ref="AssemblyMaterialName_FormItem" prop="AssemblyMaterialName" :label="$t('message.autotrans._Model_ProductBOM_assemblyMaterialName')">
            <el-input v-model="searchDataProductBOM.AssemblyMaterialName" clearable></el-input>
        </el-form-item>

        </el-col>
        <el-col :xs="24" :lg="8" class="mb20">
        <el-form-item ref="AssemblyMaterialRegex_FormItem" prop="AssemblyMaterialRegex" :label="$t('message.autotrans._Model_ProductBOM_assemblyMaterialRegex')">
            <el-input v-model="searchDataProductBOM.AssemblyMaterialRegex" clearable></el-input>
        </el-form-item>

        </el-col>
        <el-col :xs="24" :lg="8" class="mb20">
        <el-form-item ref="AssemblyMaterialVersion_FormItem" prop="AssemblyMaterialVersion" :label="$t('message.autotrans._Model_ProductBOM_assemblyMaterialVersion')">
            <el-input v-model="searchDataProductBOM.AssemblyMaterialVersion" clearable></el-input>
        </el-form-item>

        </el-col>
        <el-col :xs="24" :lg="8" class="mb20">
        <el-form-item ref="AssemblyUnitCode_FormItem" prop="AssemblyUnitCode" :label="$t('message.autotrans._Model_ProductBOM_assemblyUnitCode')">
            <el-input v-model="searchDataProductBOM.AssemblyUnitCode" clearable></el-input>
        </el-form-item>

        </el-col>
        <el-col :xs="24" :lg="8" class="mb20">
        <el-form-item ref="AutoMaterialDeduction_FormItem" prop="AutoMaterialDeduction" :label="$t('message.autotrans._Model_ProductBOM_autoMaterialDeduction')">
            <el-input v-model="searchDataProductBOM.AutoMaterialDeduction" clearable></el-input>
        </el-form-item>

        </el-col>
        <el-col :xs="24" :lg="8" class="mb20">
        <el-form-item ref="EditTime_FormItem" prop="EditTime" :label="$t('message.autotrans._Model_ProductBOM_editTime')">
            <el-input v-model="searchDataProductBOM.EditTime" clearable></el-input>
        </el-form-item>

        </el-col>
        <el-col :xs="24" :lg="8" class="mb20">
        <el-form-item ref="Field1_FormItem" prop="Field1" :label="$t('message.autotrans._Model_ProductBOM_field1')">
            <el-input v-model="searchDataProductBOM.Field1" clearable></el-input>
        </el-form-item>

        </el-col>
        <el-col :xs="24" :lg="8" class="mb20">
        <el-form-item ref="Field2_FormItem" prop="Field2" :label="$t('message.autotrans._Model_ProductBOM_field2')">
            <el-input v-model="searchDataProductBOM.Field2" clearable></el-input>
        </el-form-item>

        </el-col>
        <el-col :xs="24" :lg="8" class="mb20">
        <el-form-item ref="Field3_FormItem" prop="Field3" :label="$t('message.autotrans._Model_ProductBOM_field3')">
            <el-input v-model="searchDataProductBOM.Field3" clearable></el-input>
        </el-form-item>

        </el-col>
        <el-col :xs="24" :lg="8" class="mb20">
        <el-form-item ref="Field4_FormItem" prop="Field4" :label="$t('message.autotrans._Model_ProductBOM_field4')">
            <el-input v-model="searchDataProductBOM.Field4" clearable></el-input>
        </el-form-item>

        </el-col>
        <el-col :xs="24" :lg="8" class="mb20">
        <el-form-item ref="Field5_FormItem" prop="Field5" :label="$t('message.autotrans._Model_ProductBOM_field5')">
            <el-input v-model="searchDataProductBOM.Field5" clearable></el-input>
        </el-form-item>

        </el-col>
        <el-col :xs="24" :lg="8" class="mb20">
        <el-form-item ref="IsDelete_FormItem" prop="IsDelete" :label="$t('message.autotrans._Model_ProductBOM_isDelete')">
            <el-input v-model="searchDataProductBOM.IsDelete" clearable></el-input>
        </el-form-item>

        </el-col>
        <el-col :xs="24" :lg="8" class="mb20">
        <el-form-item ref="MaterialCode_FormItem" prop="MaterialCode" :label="$t('message.autotrans._Model_ProductBOM_materialCode')">
            <el-input v-model="searchDataProductBOM.MaterialCode" clearable></el-input>
        </el-form-item>

        </el-col>
        <el-col :xs="24" :lg="8" class="mb20">
        <el-form-item ref="MaterialId_FormItem" prop="MaterialId" :label="$t('message.autotrans._Model_ProductBOM_materialId')">
            <el-input v-model="searchDataProductBOM.MaterialId" clearable></el-input>
        </el-form-item>

        </el-col>
        <el-col :xs="24" :lg="8" class="mb20">
        <el-form-item ref="MaterialName_FormItem" prop="MaterialName" :label="$t('message.autotrans._Model_ProductBOM_materialName')">
            <el-input v-model="searchDataProductBOM.MaterialName" clearable></el-input>
        </el-form-item>

        </el-col>
        <el-col :xs="24" :lg="8" class="mb20">
        <el-form-item ref="MaterialRegex_FormItem" prop="MaterialRegex" :label="$t('message.autotrans._Model_ProductBOM_materialRegex')">
            <el-input v-model="searchDataProductBOM.MaterialRegex" clearable></el-input>
        </el-form-item>

        </el-col>
        <el-col :xs="24" :lg="8" class="mb20">
        <el-form-item ref="MaterialSort_FormItem" prop="MaterialSort" :label="$t('message.autotrans._Model_ProductBOM_materialSort')">
            <el-input v-model="searchDataProductBOM.MaterialSort" clearable></el-input>
        </el-form-item>

        </el-col>
        <el-col :xs="24" :lg="8" class="mb20">
        <el-form-item ref="MaterialVersion_FormItem" prop="MaterialVersion" :label="$t('message.autotrans._Model_ProductBOM_materialVersion')">
            <el-input v-model="searchDataProductBOM.MaterialVersion" clearable></el-input>
        </el-form-item>

        </el-col>
        <el-col :xs="24" :lg="8" class="mb20">
        <el-form-item ref="OrderId_FormItem" prop="OrderId" :label="$t('message.autotrans._Model_ProductBOM_orderId')">
            <el-input v-model="searchDataProductBOM.OrderId" clearable></el-input>
        </el-form-item>

        </el-col>
        <el-col :xs="24" :lg="8" class="mb20">
        <el-form-item ref="OrderQty_FormItem" prop="OrderQty" :label="$t('message.autotrans._Model_ProductBOM_orderQty')">
            <el-input v-model="searchDataProductBOM.OrderQty" clearable></el-input>
        </el-form-item>

        </el-col>
        <el-col :xs="24" :lg="8" class="mb20">
        <el-form-item ref="ProductBomId_FormItem" prop="ProductBomId" :label="$t('message.autotrans._Model_ProductBOM_productBomId')">
            <el-input v-model="searchDataProductBOM.ProductBomId" clearable></el-input>
        </el-form-item>

        </el-col>
        <el-col :xs="24" :lg="8" class="mb20">
        <el-form-item ref="ReplaceMaterialList_FormItem" prop="ReplaceMaterialList" :label="$t('message.autotrans._Model_ProductBOM_replaceMaterialList')">
            <el-input v-model="searchDataProductBOM.ReplaceMaterialList" clearable></el-input>
        </el-form-item>

        </el-col>
        <el-col :xs="24" :lg="8" class="mb20">
        <el-form-item ref="Replaces_FormItem" prop="Replaces" :label="$t('message.autotrans._Model_ProductBOM_replaces')">
            <el-input v-model="searchDataProductBOM.Replaces" clearable></el-input>
        </el-form-item>

        </el-col>
        <el-col :xs="24" :lg="8" class="mb20">
        <el-form-item ref="Retroactive_FormItem" prop="Retroactive" :label="$t('message.autotrans._Model_ProductBOM_retroactive')">
            <el-input v-model="searchDataProductBOM.Retroactive" clearable></el-input>
        </el-form-item>

        </el-col>
        <el-col :xs="24" :lg="8" class="mb20">
        <el-form-item ref="RouteBomCode_FormItem" prop="RouteBomCode" :label="$t('message.autotrans._Model_ProductBOM_routeBomCode')">
            <el-input v-model="searchDataProductBOM.RouteBomCode" clearable></el-input>
        </el-form-item>

        </el-col>
        <el-col :xs="24" :lg="8" class="mb20">
        <el-form-item ref="RouteBomName_FormItem" prop="RouteBomName" :label="$t('message.autotrans._Model_ProductBOM_routeBomName')">
            <el-input v-model="searchDataProductBOM.RouteBomName" clearable></el-input>
        </el-form-item>

        </el-col>
        <el-col :xs="24" :lg="8" class="mb20">
        <el-form-item ref="RouteNumber_FormItem" prop="RouteNumber" :label="$t('message.autotrans._Model_ProductBOM_routeNumber')">
            <el-input v-model="searchDataProductBOM.RouteNumber" clearable></el-input>
        </el-form-item>

        </el-col>
        <el-col :xs="24" :lg="8" class="mb20">
        <el-form-item ref="ShipRegularCheck_FormItem" prop="ShipRegularCheck" :label="$t('message.autotrans._Model_ProductBOM_shipRegularCheck')">
            <el-input v-model="searchDataProductBOM.ShipRegularCheck" clearable></el-input>
        </el-form-item>

        </el-col>
        <el-col :xs="24" :lg="8" class="mb20">
        <el-form-item ref="ShopOrderOperationMaterialId_FormItem" prop="ShopOrderOperationMaterialId" :label="$t('message.autotrans._Model_ProductBOM_shopOrderOperationMaterialId')">
            <el-input v-model="searchDataProductBOM.ShopOrderOperationMaterialId" clearable></el-input>
        </el-form-item>

        </el-col>
      </el-row>

  </WtmSearcher>

  <div style="text-align: right;">
      <WtmButton v-auth="'/api/BaseInformation/ProductBOM/Create'" icon='fa fa-plus' type='primary' :button-text="$t('message.autotrans.SysCreate')" @click="OnCreateClick()"/>
    <WtmButton v-auth="'/api/BaseInformation/ProductBOM/BatchDelete'"  icon='fa fa-trash' type='danger' :button-text="$t('message.autotrans.SysDelete')" :confirm="$t('message._system.common.vm.deletetip')" @click="onBatchDelete()"/>
    <WtmButton v-auth="'/api/BaseInformation/ProductBOM/BatchEdit'" icon='fa fa-pencil-square' type='primary' :button-text="$t('message.autotrans.SysBatchEdit')" @click="OnBatchEditClick()"/>
    <WtmButton v-auth="'/api/BaseInformation/ProductBOM/Import'" icon='fa fa-tasks' type='primary' :button-text="$t('message.autotrans.SysImport')" @click="OnImportClick()"/>
    <WtmButton v-auth="'/api/BaseInformation/ProductBOM/ProductBOMExportExcel'"  icon='fa fa-arrow-circle-down' type='primary' :button-text="$t('message.autotrans.SysExport')" @click="onExport()"/>

  </div>
  <WtmTable ref="tableRefProductBOM" v-bind="tableDataProductBOM">
    <template #operation>
      <el-table-column :label="$t('message._system.common.vm.operate')" width="180">
        <template v-slot="scope">
            <WtmButton v-auth="'/api/BaseInformation/ProductBOM/Edit'" :is-text="true" icon='fa fa-pencil-square' type='warning' :button-text="$t('message.autotrans.SysEdit')" @click="OnEditrowClick(scope.row)"/>
          <WtmButton v-auth="'/api/BaseInformation/ProductBOM/{id}'" :is-text="true" icon='fa fa-info-circle' type='info' :button-text="$t('message.autotrans.Page详情')" @click="OnDetailsrowClick(scope.row)"/>
          <WtmButton v-auth="'/api/BaseInformation/ProductBOM/BatchDelete'"  icon='fa fa-trash' type='danger' :button-text="$t('message.autotrans.SysDelete')" :confirm="$t('message._system.common.vm.deletetip')" :is-text="true"  @click="onDelete(scope.row)"/>

        </template>
      </el-table-column>
    </template>
  </WtmTable>

</el-card>
</div>
</template>


<script setup lang="ts" name="message.autotrans._PageBaseInformationProductBOMIndex;true;TyMES.BaseInformation.Controllers;ProductBOM">
import {  ElMessageBox, ElMessage,ElLoading } from 'element-plus';
import { defineAsyncComponent,reactive, ref, getCurrentInstance, onMounted, nextTick } from 'vue';
import { productbomApi } from '/@/api/baseinformation/productbom';
import other from '/@/utils/other';
import fileApi from '/@/api/file';
import { useRouter } from "vue-router";
const ci = getCurrentInstance() as any;

const CreateDialog = defineAsyncComponent(() => import('./create.vue'));
const EditDialog = defineAsyncComponent(() => import('./edit.vue'));
const DetailsDialog = defineAsyncComponent(() => import('./details.vue'));
const BatchEditDialog = defineAsyncComponent(() => import('./batchedit.vue'));
const ImportDialog = defineAsyncComponent(() => import('./import.vue'));

const stateProductBOM = reactive({
    
});

const searchDataProductBOM = ref({
        FactoryCode: '',
        Assemblyline: '',
        OperationCode: '',
        OrderCode: '',
        ScheduleNumber: '',
        AddTime: '',
        AssemblyConsumption: '',
        AssemblyMaterialCode: '',
        AssemblyMaterialId: '',
        AssemblyMaterialName: '',
        AssemblyMaterialRegex: '',
        AssemblyMaterialVersion: '',
        AssemblyUnitCode: '',
        AutoMaterialDeduction: null,
        EditTime: '',
        Field1: '',
        Field2: '',
        Field3: '',
        Field4: '',
        Field5: '',
        IsDelete: '',
        MaterialCode: '',
        MaterialId: '',
        MaterialName: '',
        MaterialRegex: '',
        MaterialSort: '',
        MaterialVersion: '',
        OrderId: '',
        OrderQty: '',
        ProductBomId: '',
        ReplaceMaterialList: '',
        Replaces: null,
        Retroactive: '',
        RouteBomCode: '',
        RouteBomName: '',
        RouteNumber: '',
        ShipRegularCheck: '',
        ShopOrderOperationMaterialId: '',
});

// 定义变量内容
const tableRefProductBOM = ref();
const tableDataProductBOM = ref({
    // 列表数据（必传）
    data: [],
	// 表头内容（必传，注意格式）
	header: [
      {title:ci.proxy.$t('message.autotrans.Page工厂编码'),key: 'ProductBOM_factoryCode',type: 'text',isCheck: true},
      {title:ci.proxy.$t('message.autotrans.Page装配产线'),key: 'ProductBOM_assemblyline',type: 'text',isCheck: true},
      {title:ci.proxy.$t('message.autotrans.Page工序编码'),key: 'ProductBOM_operationCode',type: 'text',isCheck: true},
      {title:ci.proxy.$t('message.autotrans.Page工单编码'),key: 'ProductBOM_orderCode',type: 'text',isCheck: true},
      {title:ci.proxy.$t('message.autotrans.Page排程号'),key: 'ProductBOM_scheduleNumber',type: 'text',isCheck: true},
      {title:ci.proxy.$t('message.autotrans.Page添加时间'),key: 'ProductBOM_addTime',type: 'text',isCheck: true},
      {title:ci.proxy.$t('message.autotrans.Page组件物料数量'),key: 'ProductBOM_assemblyConsumption',type: 'text',isCheck: true},
      {title:ci.proxy.$t('message.autotrans.Page组件物料编码'),key: 'ProductBOM_assemblyMaterialCode',type: 'text',isCheck: true},
      {title:ci.proxy.$t('message.autotrans.Page组件物料Id'),key: 'ProductBOM_assemblyMaterialId',type: 'text',isCheck: true},
      {title:ci.proxy.$t('message.autotrans.Page组件物料名称'),key: 'ProductBOM_assemblyMaterialName',type: 'text',isCheck: true},
      {title:ci.proxy.$t('message.autotrans.Page组件物料正则规则'),key: 'ProductBOM_assemblyMaterialRegex',type: 'text',isCheck: true},
      {title:ci.proxy.$t('message.autotrans.Page组件物料版本'),key: 'ProductBOM_assemblyMaterialVersion',type: 'text',isCheck: true},
      {title:ci.proxy.$t('message.autotrans.Page组件物料单位编码'),key: 'ProductBOM_assemblyUnitCode',type: 'text',isCheck: true},
      {title:ci.proxy.$t('message.autotrans.Page装配扣除额'),key: 'ProductBOM_autoMaterialDeduction',type: 'text',isCheck: true},
      {title:ci.proxy.$t('message.autotrans.Page编辑时间'),key: 'ProductBOM_editTime',type: 'text',isCheck: true},
      {title:"产品校验",key: 'ProductBOM_field1',type: 'text',isCheck: true},
      {title:ci.proxy.$t('message.autotrans.Page备用字段2'),key: 'ProductBOM_field2',type: 'text',isCheck: true},
      {title:ci.proxy.$t('message.autotrans.Page备用字段3'),key: 'ProductBOM_field3',type: 'text',isCheck: true},
      {title:ci.proxy.$t('message.autotrans.Page备用字段4'),key: 'ProductBOM_field4',type: 'text',isCheck: true},
      {title:ci.proxy.$t('message.autotrans.Page备用字段5'),key: 'ProductBOM_field5',type: 'text',isCheck: true},
      {title:ci.proxy.$t('message.autotrans.Page是否删除'),key: 'ProductBOM_isDelete',type: 'text',isCheck: true},
      {title:ci.proxy.$t('message.autotrans.Page物料编码'),key: 'ProductBOM_materialCode',type: 'text',isCheck: true},
      {title:ci.proxy.$t('message.autotrans.Page物料Id'),key: 'ProductBOM_materialId',type: 'text',isCheck: true},
      {title:ci.proxy.$t('message.autotrans.Page物料名称'),key: 'ProductBOM_materialName',type: 'text',isCheck: true},
      {title:ci.proxy.$t('message.autotrans.Page物料正则'),key: 'ProductBOM_materialRegex',type: 'text',isCheck: true},
      {title:ci.proxy.$t('message.autotrans.Page物料排序'),key: 'ProductBOM_materialSort',type: 'text',isCheck: true},
      {title:ci.proxy.$t('message.autotrans.Page物料版本'),key: 'ProductBOM_materialVersion',type: 'text',isCheck: true},
      {title:ci.proxy.$t('message.autotrans.Page工单Id'),key: 'ProductBOM_orderId',type: 'text',isCheck: true},
      {title:ci.proxy.$t('message.autotrans.Page工单数量'),key: 'ProductBOM_orderQty',type: 'text',isCheck: true},
      {title:ci.proxy.$t('message.autotrans.Page产品BOM编号'),key: 'ProductBOM_productBomId',type: 'text',isCheck: true},
      {title:ci.proxy.$t('message.autotrans.Page替换物料表'),key: 'ProductBOM_replaceMaterialList',type: 'text',isCheck: true},
      {title:ci.proxy.$t('message.autotrans.Page替换用量'),key: 'ProductBOM_replaces',type: 'text',isCheck: true},
      {title:ci.proxy.$t('message.autotrans.Page追溯方式'),key: 'ProductBOM_retroactive',type: 'text',isCheck: true},
      {title:ci.proxy.$t('message.autotrans.Page工艺BOM编码'),key: 'ProductBOM_routeBomCode',type: 'text',isCheck: true},
      {title:ci.proxy.$t('message.autotrans.Page工艺BOM名称'),key: 'ProductBOM_routeBomName',type: 'text',isCheck: true},
      {title:ci.proxy.$t('message.autotrans.Page工艺路线编码'),key: 'ProductBOM_routeNumber',type: 'text',isCheck: true},
      {title:ci.proxy.$t('message.autotrans.Page出货规则校验'),key: 'ProductBOM_shipRegularCheck',type: 'text',isCheck: true},
      {title:ci.proxy.$t('message.autotrans.Page工单工序物料关联id'),key: 'ProductBOM_shopOrderOperationMaterialId',type: 'text',isCheck: true},

	],
	// 配置项（必传）
	config: {
        total: 0, // 列表总数
		loading: true, // loading 加载
		isSerialNo: true, // 是否显示表格序号
		isSelection: true, // 是否显示表格多选
		isOperate: true, // 是否显示表格操作栏
	}
});
// 初始化表格数据
const getTableDataProductBOM = () => {
    tableRefProductBOM.value.doSearch(productbomApi().search, searchDataProductBOM.value)
        .catch((error: any) => {
			other.setFormError(ci, error);
		});
};
const OnCreateClick = () => {
    other.openDialog(ci.proxy.$t('message.autotrans.SysCreate'), CreateDialog, null, getTableDataProductBOM)
};

const OnEditrowClick = (row: any) => {
    other.openDialog(ci.proxy.$t('message.autotrans.SysEdit'), EditDialog, row, getTableDataProductBOM)
};

const OnDetailsrowClick = (row: any) => {
    other.openDialog(ci.proxy.$t('message.autotrans.Page详情'), DetailsDialog, row, getTableDataProductBOM)
};

// 删除
const onDelete = (row: any) => {
    productbomApi().delete([row.ID]).then(() => { getTableDataProductBOM()})
};

const onBatchDelete = () => {
    const selectedrows = tableRefProductBOM.value.getSelectedRows();
    const selectedids = selectedrows.map((x: any) => x.ID);
    if (selectedids.length > 0)
      productbomApi().delete(selectedids).then(() => { getTableDataProductBOM()})
    else
      ElMessage.error(ci.proxy.$t('message._system.common.vm.check'));
};

const OnBatchEditClick = () => {
    const selectedrows = tableRefProductBOM.value.getSelectedRows();
    const selectedids = selectedrows.map((x: any) => x.ID);
    if (selectedids.length > 0)
      other.openDialog(ci.proxy.$t('message.autotrans.SysBatchEdit'), BatchEditDialog, selectedids, getTableDataProductBOM)
    else
      ElMessage.error(ci.proxy.$t('message._system.common.vm.check'));
};

const OnImportClick = () => {
    other.openDialog(ci.proxy.$t('message.autotrans.SysImport'), ImportDialog, null, getTableDataProductBOM)
};

const onExport = () => {
	const selected = tableRefProductBOM.value.getSelectedRows();
	if (selected.length > 0) {
		productbomApi().exportById(selected.map((x: any) => x.ID));
	}
	else {
		productbomApi().export(searchDataProductBOM.value);
	}
};

// 页面加载时
onMounted(() => {
    
        getTableDataProductBOM();

});

// 暴露变量
defineExpose({

});
</script>

<style scoped lang="scss">

</style>

